﻿using Gengens.Disk.WebApi.dto.input.file;
using Gengens.Disk.WebApi.util;

namespace Gengens.Disk.WebApi.dto.output.file
{
    /// <summary>
    /// 大文件前置信息
    /// </summary>
    public class PreFileInfo
    {
        public Guid Id { get; set; } = Guid.NewGuid();
        public Guid UserId { get; set; }
        public string Username { get; set; }
        public string Name { get; set; }
        public string Url { get; set; }
        public long SplitCount { get; set; }
        public long ExecutedCount { get; set; } = 0;
        public DateTime BeginTime { get; set; } = DateTime.Now;
        public DateTime UpdateTime { get; set; } = DateTime.Now;

        public PreFileInfo(PreFileForCreateDto createDto,Guid userid, string username)
        {
            Name = createDto.Name;
            SplitCount = createDto.SplitCount;
            UserId = userid;
            Username = username;
            Url = FileUtils.getPath(Name,username);
        }
    }
}
